<!DOCTYPE html>
<html lang="en" xmlns:sec="http://www.w3.org/1999/xhtml" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
</head>
<body>

<p>欢迎您 <span sec:authentication="principal.username">User</span></p>
<p><a th:href="@{/logout}">登出</a></p>
<div sec:authorize="hasRole('ROLE_ADMIN')">
    <h3>如果你是管理员，可以看到本条内容</h3>
    <p><a th:href="@{/admin/home}">管理员主页</a></p>
</div>

</body>
</html>